package service.impl;

import dao.PositionDao;
import entity.Position;
import org.apache.ibatis.session.SqlSession;
import service.PositionService;
import util.MyBatisUtil;

import java.sql.SQLException;
import java.util.List;

public class PositionServiceimpl implements PositionService {
    SqlSession sqlSession = MyBatisUtil.createSqlSession();

    @Override
    public List<Position> getAllPositions() throws SQLException {
        List<Position> list = sqlSession.getMapper(PositionDao.class).getAllPositions();
        MyBatisUtil.closeSqlSession(sqlSession);
        return list;
    }
}
